// 云函数入口文件
const cloud = require('wx-server-sdk')

cloud.init()
const db = cloud.database()
// 云函数入口函数
exports.main = async (event, context) => {
  var id = event.id
  var AD_ID = event.AD_ID
  var PW = event.PW
  try {
    return await db.collection('Admin').doc(id).update({
      data: {
        PW: PW,
        AD_ID: AD_ID,
      }
    })
  } catch (e) {
    console.log(e)
  }
}